<?php

namespace App\Repositories\Admin;

use App\BaseRepository;

class WithdrawRepository extends BaseRepository
{
    //模型名称
    protected $modelName = "App\Model\UserWithdraw";

    protected $allowApiMethod = ['index','show'];

    //获取结果集
    protected function getListItems()
    {

        $this->processFilter();//过滤

        $this->processSearch();//搜索

        $this->processSort();//过滤

        $this->processPages();//分页

        $this->processQueryModel = $this->beforeListShow($this->processQueryModel);

        $items = $this->processQueryModel->get();

        if($loads = $this->relationLoad()) {
            $items->load($loads);
        }

        // $items->map(function ($item){
        //     $item->appends('state_name');
        // });

        return $items;
    }

}